home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gigarom 1
/
Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso
/
FILES
/
DEV
/
I-Z
/
ResExpress 1.0.sea
/
ResExpress 1.0
/
ResX DevKit
/
Think Pascal
/
Cursor RXVW.p
next >
Wrap
Text File
|
1990-10-08
|
2KB
|
61 lines
{Cursor RXVW}
{This is an example of an RXVW code resource}
{To compile in Think Pascal:}
{ 1) Set Project Type to 'Code Resource'}
{ 2) Set the resource TYPE to 'RXVW'}
{ 3) Set the resource NAME to the resource type you are making a view for.}
{ In this example, the resource name must be 'CURS'}
{ 4) Add this file, DRVRRuntime.lib, and Interface.lib to the project}
{ 5) Compile the code resource.}
{ 6) Install it in ResX via the 'Externals->Install' menu.}
{A unit of utilities is in the works to give access to ResX internals. I'm not }
{releasing info on the Globals structure just yet. This will allow you to}
{have access to the entire ResX environment.}
unit ShowCursor;
interface
procedure main (ResHandle: Handle); {Handle of the current selected resource}
implementation
procedure main;
var
crsrHandle: CursHandle;
rsrID: integer;
rsrType: ResType;
rsrName: Str255;
HState: SignedByte;
begin
{For most views, you will only need the handle to the resource but in this case, we need}
{to know the resource ID. In this example, we do a GetCursor so do not need to load the }
{resource.}
{This is necessary because GetCursor needs the resource ID but only the Handle is given.}
GetResInfo(ResHandle, rsrID, rsrType, rsrName); {Get the resource id of the cursor}
HState := HGetState(ResHandle); {This is mandatory!}
crsrHandle := GetCursor(rsrID);
SetCursor(crsrHandle^^);
repeat
until button;
InitCursor;
HSetState(ResHandle, HState); {This is mandatory!}
{Do NOT release the resource or dispose the handle, ResX will do it if necessary. }
{This is critical in case the resource is being used by a currently running application. }
end;
end.